﻿using System;
using System.IO;
using System.Text;
using System.Windows.Forms;
using Func;
using VLF;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;

namespace VLFS {
  public partial class ServForm : Form {
    string PathApp = "";
    string NameFile = "";

    public ServForm () {
      InitializeComponent();
    }

    private void btSave_Click (object sender, EventArgs e) {
      VLF.MainForm.DS.SaveTextBox(NameFile);
    }

    private void ServForm_Load (object sender, EventArgs e) {
      // определение пути загруженной программы
#if DEBUG
        PathApp = @"d:\User\C#\VLF\VLF";
#else
      PathApp = App.GetPath("VLF");
#endif
      NameFile = PathApp + @"\computer.txt";
      VLF.MainForm.DS.WinText = this.tbServ;
      VLF.MainForm.DS.LoadTextBox(NameFile);
      this.tbServ.SelectionStart = this.tbServ.Text.Length;
      this.tbServ.ScrollToCaret();
      this.tbServ.Refresh();
      this.tbServ.Focus();
    }
  }
}
